<?php
/**
 * 
 * @author yuxun
 *
 */

class ModMessageReply extends Model {

    protected $table = 'message_reply';

    // 表名
    public function tableName(){
        return $this->table;
    }

    public static function model($className=__CLASS__){
        return parent::model($className);
    }

    public function getDbConnection(){
        return Yii::app()->dbOss;
    }

    public function addmuch($params){
    	$result = $this->getDbConnection()->multiInsert($params, $this->table, FALSE);
    	return $result;
    }
    
    public function select($message_id){
    	$table = $this->table;
    	$where  = ' WHERE message_id=:message_id ';
    	$args   = array(
    			':message_id'     => $message_id
    	);
        	
    	$fields = "*";
    	$sql = "SELECT {$fields} FROM {$table} {$where}";
    	$data = $this->getDbConnection()->query($sql, $args);    	
    	return $data;
    }
    

    
} 